package com.sliface.web.core;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sliface.web.app.Facade;

public class RequestDispatcher extends HttpServlet {
	  MethodInvoker invoker=null;
	  @Override
	  protected void service(HttpServletRequest req, HttpServletResponse resp)
	      throws ServletException, IOException {
		  
		  invoker.process(req, resp);
		  //resp.getWriter().println(RequestDispatcher.class.getClassLoader());
		  //resp.getWriter().println(Thread.currentThread().getContextClassLoader());
		 
	  }
	  @Override
	  public void init() throws ServletException {
		  if(invoker==null){
		      invoker= MethodInvoker.getInstance();
		  }
	  }	  
}
